Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lib): make it possible to use as a lib #2

Merged
merged 1 commit into from
Dec 29, 2023
Merged

feat(lib): make it possible to use as a lib #2

merged 1 commit into from
Dec 29, 2023

Conversation

joshka
Copy link
Collaborator

@joshka joshka commented Dec 28, 2023

I'd like to be able to be able to use the colors from this crate in Ratatui apps, and document it from our website (Issue ratatui/ratatui-website#318).

I think ratatui / crossterm should generally be optional deps for a lib (so this lib can be used by non-ratatui apps without including extraneous deps), but there isn't a good way yet to only have optional deps for the lib (rust-lang/cargo#1982). The other alternative to this PR would be to split this into two separate crates, one for the cli and one for the lib, but the crate name material makes a really good import name. The downside is that installation now needs a --features=cli to enable the right features. I think this is a reasonable tradeoff.

Docs for the colors module render with little squares for the colors:

image

Added --locked to the install command in order to avoid installing different versions than are specified in the cargo.lock file. This is generally good practice for apps to avoid breaking users when new versions of libs are released.

@joshka joshka mentioned this pull request Dec 29, 2023
@azorng azorng merged commit 5ccbba1 into azorng:master Dec 29, 2023
@joshka joshka deleted the lib branch December 30, 2023 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants